package com.frank.subject.infra.basic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.frank.subject.infra.basic.entity.SubjectCategory;
import com.frank.subject.infra.basic.mapper.SubjectCategoryMapper;
import com.frank.subject.infra.basic.service.SubjectCategoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 题目分类(SubjectCategory)表服务实现类
 *
 * @author makejava
 * @since 2024-01-23 17:04:30
 */
@Service("subjectCategoryService")
public class SubjectCategoryServiceImpl extends ServiceImpl<SubjectCategoryMapper, SubjectCategory>  implements SubjectCategoryService {

    private final SubjectCategoryMapper subjectCategoryMapper;

    public SubjectCategoryServiceImpl(SubjectCategoryMapper subjectCategoryMapper) {
        this.subjectCategoryMapper = subjectCategoryMapper;
    }

    @Override
    public List<SubjectCategory> queryCategoryByPrimary(SubjectCategory subjectCategory) {
        return subjectCategoryMapper.queryCategoryByPrimary(subjectCategory);
    }

    public Integer querySubjectCount(Long categoryId) {
        return this.subjectCategoryMapper.querySubjectCount(categoryId);
    }
}
